package net.chery.api;

import lombok.AllArgsConstructor;
import net.chery.service.EtlService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gai
 */
@RestController
@AllArgsConstructor
public class HiveApi {
    private final EtlService etlService;

    @RequestMapping("/desc")
    public List<List<String>> desc(String table){
        return etlService.desc(table);
    }

    @RequestMapping("/query")
    public List<List<Object>> query(@RequestBody String sql){
        return etlService.query(sql);
    }
}
